package com.gtw.modules.api.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.gtw.modules.api.service.TbCharmvalueNotesService;
import com.gtw.modules.dao.TbCharmvalueNotesDao;
import com.gtw.modules.entity.TbCharmvalueNotes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;


@Service("charmvalueNotesservice")
public class TbCharmvalueNotesServiceImpl implements TbCharmvalueNotesService {
    @Autowired
    private TbCharmvalueNotesDao charmvalueNotesDao;

    @Override
    public TbCharmvalueNotes queryObject(Integer id) {
        return charmvalueNotesDao.selectByPrimaryKey(id);
    }

    @Override
    @Transactional(rollbackFor=Exception.class)
    public void save(TbCharmvalueNotes charmvalueNotes) {
        charmvalueNotesDao.insert(charmvalueNotes);
    }

    @Override
    @Transactional(rollbackFor=Exception.class)
    public void update(TbCharmvalueNotes charmvalueNotes) {
        charmvalueNotesDao.updateByPrimaryKey(charmvalueNotes);
    }

    @Override
    @Transactional(rollbackFor=Exception.class)
    public void delete(Integer id) {
        charmvalueNotesDao.deleteByPrimaryKey(id);
    }

    @Override
    public Page<TbCharmvalueNotes> queryPageList(Page<TbCharmvalueNotes> pageUtil, Map<String, Object> map) {
        pageUtil.setRecords(charmvalueNotesDao.queryPageList(pageUtil, map));
        return pageUtil;
    }

}
